package org.cloud.ext.mq.common;

/**
 * 消息类型
 * @author xukk
 * @date 2020/3/10
 */
public enum PushTypeEnum {
    /**
     * websocket
     */
    WEBSOCKET(0),
    /**
     * 未知
     */
    UNKNOWN(9);
    private Integer code;

    PushTypeEnum(int code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public static PushTypeEnum convert(Integer type){
        for (PushTypeEnum pushTypeEnum : values()) {
            if(pushTypeEnum.getCode().equals(type)){
                return pushTypeEnum;
            }
        }
        return PushTypeEnum.UNKNOWN;

    }
}
